Skip to content

gh-153182: Explicitly return NULL when new_keys_object call fails in _PyDict_NewKeysForClass#153183

Closed
stestagg wants to merge 1 commit into
python:mainfrom
stestagg:gh-153182
Closed

gh-153182: Explicitly return NULL when new_keys_object call fails in _PyDict_NewKeysForClass#153183
stestagg wants to merge 1 commit into
python:mainfrom
stestagg:gh-153182

Conversation

@stestagg

@stestagg stestagg commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This prevents a segfault when code further down the function tries to populate keys with the contents of __static_attributes__

…ails in `_PyDict_NewKeysForClass` to prevent

a segfault when subsequent code tries to use the returned object
@stestagg

stestagg commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @methane!

@kumaraditya303

Copy link
Copy Markdown
Contributor

There is a merge conflict.

@stestagg

stestagg commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @kumaraditya303. It looks like this PR:
#150490: Raise PyType_Modified for insertion into split dictionary (take 2) (#152914)

Also made this change, so this is now defunct
2092192#diff-b08a47ddc5bc20b2e99ac2e5aa199ca24a56b994e7bc64e918513356088c20aeR7270

@stestagg stestagg closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants